package ned

class Installation {

	int startPosition
	int height
	
	static belongsTo = [rack:Rack]
	
    static constraints = {
    	rack(nullable: false)
    	startPosition(nullable: false, min: 0)
    	height(nullable: false, min: 0)
    }
    
    def getEndPosition() {
    	startPosition+height
    }
    
    String toString() {"${rack}:${startPosition}:${height}"}
}
